<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - Lua 5.1.5 - src/lvm.c</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - lvm.c</td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">Lua 5.1.5</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">460</td>
            <td class="headerCovTableEntry">477</td>
            <td class="headerCovTableEntryHi">96.4 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2019-06-13 19:44:15</td>
            <td></td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<span class="lineNum">       1 </span>            : /*
<span class="lineNum">       2 </span>            : ** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
<span class="lineNum">       3 </span>            : ** Lua virtual machine
<span class="lineNum">       4 </span>            : ** See Copyright Notice in lua.h
<span class="lineNum">       5 </span>            : */
<span class="lineNum">       6 </span>            : 
<span class="lineNum">       7 </span>            : 
<span class="lineNum">       8 </span>            : #include &lt;stdio.h&gt;
<span class="lineNum">       9 </span>            : #include &lt;stdlib.h&gt;
<span class="lineNum">      10 </span>            : #include &lt;string.h&gt;
<span class="lineNum">      11 </span>            : 
<span class="lineNum">      12 </span>            : #define lvm_c
<span class="lineNum">      13 </span>            : #define LUA_CORE
<span class="lineNum">      14 </span>            : 
<span class="lineNum">      15 </span>            : #include &quot;lua.h&quot;
<span class="lineNum">      16 </span>            : 
<span class="lineNum">      17 </span>            : #include &quot;ldebug.h&quot;
<span class="lineNum">      18 </span>            : #include &quot;ldo.h&quot;
<span class="lineNum">      19 </span>            : #include &quot;lfunc.h&quot;
<span class="lineNum">      20 </span>            : #include &quot;lgc.h&quot;
<span class="lineNum">      21 </span>            : #include &quot;lobject.h&quot;
<span class="lineNum">      22 </span>            : #include &quot;lopcodes.h&quot;
<span class="lineNum">      23 </span>            : #include &quot;lstate.h&quot;
<span class="lineNum">      24 </span>            : #include &quot;lstring.h&quot;
<span class="lineNum">      25 </span>            : #include &quot;ltable.h&quot;
<span class="lineNum">      26 </span>            : #include &quot;ltm.h&quot;
<span class="lineNum">      27 </span>            : #include &quot;lvm.h&quot;
<span class="lineNum">      28 </span>            : 
<span class="lineNum">      29 </span>            : 
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span>            : /* limit for table tag-method chains (to avoid loops) */
<span class="lineNum">      32 </span>            : #define MAXTAGLOOP      100
<span class="lineNum">      33 </span>            : 
<span class="lineNum">      34 </span>            : 
<span class="lineNum">      35 </span><span class="lineCov">        322 : const TValue *luaV_tonumber (const TValue *obj, TValue *n) {</span>
<span class="lineNum">      36 </span>            :   lua_Number num;
<span class="lineNum">      37 </span><span class="lineCov">        322 :   if (ttisnumber(obj)) return obj;</span>
<span class="lineNum">      38 </span><span class="lineCov">        275 :   if (ttisstring(obj) &amp;&amp; luaO_str2d(svalue(obj), &amp;num)) {</span>
<span class="lineNum">      39 </span><span class="lineCov">         87 :     setnvalue(n, num);</span>
<span class="lineNum">      40 </span><span class="lineCov">         87 :     return n;</span>
<span class="lineNum">      41 </span>            :   }
<span class="lineNum">      42 </span>            :   else
<span class="lineNum">      43 </span><span class="lineCov">        188 :     return NULL;</span>
<span class="lineNum">      44 </span>            : }
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            : 
<span class="lineNum">      47 </span><span class="lineCov">       2136 : int luaV_tostring (lua_State *L, StkId obj) {</span>
<span class="lineNum">      48 </span><span class="lineCov">       2136 :   if (!ttisnumber(obj))</span>
<span class="lineNum">      49 </span><span class="lineCov">         10 :     return 0;</span>
<span class="lineNum">      50 </span>            :   else {
<span class="lineNum">      51 </span>            :     char s[LUAI_MAXNUMBER2STR];
<span class="lineNum">      52 </span><span class="lineCov">       2126 :     lua_Number n = nvalue(obj);</span>
<span class="lineNum">      53 </span><span class="lineCov">       2126 :     lua_number2str(s, n);</span>
<span class="lineNum">      54 </span><span class="lineCov">       2126 :     setsvalue2s(L, obj, luaS_new(L, s));</span>
<span class="lineNum">      55 </span><span class="lineCov">       2126 :     return 1;</span>
<span class="lineNum">      56 </span>            :   }
<span class="lineNum">      57 </span>            : }
<span class="lineNum">      58 </span>            : 
<span class="lineNum">      59 </span>            : 
<span class="lineNum">      60 </span><span class="lineCov">         32 : static void traceexec (lua_State *L, const Instruction *pc) {</span>
<span class="lineNum">      61 </span><span class="lineCov">         32 :   lu_byte mask = L-&gt;hookmask;</span>
<span class="lineNum">      62 </span><span class="lineCov">         32 :   const Instruction *oldpc = L-&gt;savedpc;</span>
<span class="lineNum">      63 </span><span class="lineCov">         32 :   L-&gt;savedpc = pc;</span>
<span class="lineNum">      64 </span><span class="lineCov">         32 :   if ((mask &amp; LUA_MASKCOUNT) &amp;&amp; L-&gt;hookcount == 0) {</span>
<span class="lineNum">      65 </span><span class="lineCov">         32 :     resethookcount(L);</span>
<span class="lineNum">      66 </span><span class="lineCov">         32 :     luaD_callhook(L, LUA_HOOKCOUNT, -1);</span>
<span class="lineNum">      67 </span>            :   }
<span class="lineNum">      68 </span><span class="lineCov">         32 :   if (mask &amp; LUA_MASKLINE) {</span>
<span class="lineNum">      69 </span><span class="lineNoCov">          0 :     Proto *p = ci_func(L-&gt;ci)-&gt;l.p;</span>
<span class="lineNum">      70 </span><span class="lineNoCov">          0 :     int npc = pcRel(pc, p);</span>
<span class="lineNum">      71 </span><span class="lineNoCov">          0 :     int newline = getline(p, npc);</span>
<span class="lineNum">      72 </span>            :     /* call linehook when enter a new function, when jump back (loop),
<span class="lineNum">      73 </span>            :        or when enter a new line */
<span class="lineNum">      74 </span><span class="lineNoCov">          0 :     if (npc == 0 || pc &lt;= oldpc || newline != getline(p, pcRel(oldpc, p)))</span>
<span class="lineNum">      75 </span><span class="lineNoCov">          0 :       luaD_callhook(L, LUA_HOOKLINE, newline);</span>
<span class="lineNum">      76 </span>            :   }
<span class="lineNum">      77 </span><span class="lineCov">         32 : }</span>
<span class="lineNum">      78 </span>            : 
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span><span class="lineCov">         44 : static void callTMres (lua_State *L, StkId res, const TValue *f,</span>
<span class="lineNum">      81 </span>            :                         const TValue *p1, const TValue *p2) {
<span class="lineNum">      82 </span><span class="lineCov">         44 :   ptrdiff_t result = savestack(L, res);</span>
<span class="lineNum">      83 </span><span class="lineCov">         44 :   setobj2s(L, L-&gt;top, f);  /* push function */</span>
<span class="lineNum">      84 </span><span class="lineCov">         44 :   setobj2s(L, L-&gt;top+1, p1);  /* 1st argument */</span>
<span class="lineNum">      85 </span><span class="lineCov">         44 :   setobj2s(L, L-&gt;top+2, p2);  /* 2nd argument */</span>
<span class="lineNum">      86 </span><span class="lineCov">         44 :   luaD_checkstack(L, 3);</span>
<span class="lineNum">      87 </span><span class="lineCov">         44 :   L-&gt;top += 3;</span>
<span class="lineNum">      88 </span><span class="lineCov">         44 :   luaD_call(L, L-&gt;top - 3, 1);</span>
<span class="lineNum">      89 </span><span class="lineCov">         44 :   res = restorestack(L, result);</span>
<span class="lineNum">      90 </span><span class="lineCov">         44 :   L-&gt;top--;</span>
<span class="lineNum">      91 </span><span class="lineCov">         44 :   setobjs2s(L, res, L-&gt;top);</span>
<span class="lineNum">      92 </span><span class="lineCov">         44 : }</span>
<span class="lineNum">      93 </span>            : 
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span>            : 
<span class="lineNum">      96 </span><span class="lineCov">          4 : static void callTM (lua_State *L, const TValue *f, const TValue *p1,</span>
<span class="lineNum">      97 </span>            :                     const TValue *p2, const TValue *p3) {
<span class="lineNum">      98 </span><span class="lineCov">          4 :   setobj2s(L, L-&gt;top, f);  /* push function */</span>
<span class="lineNum">      99 </span><span class="lineCov">          4 :   setobj2s(L, L-&gt;top+1, p1);  /* 1st argument */</span>
<span class="lineNum">     100 </span><span class="lineCov">          4 :   setobj2s(L, L-&gt;top+2, p2);  /* 2nd argument */</span>
<span class="lineNum">     101 </span><span class="lineCov">          4 :   setobj2s(L, L-&gt;top+3, p3);  /* 3th argument */</span>
<span class="lineNum">     102 </span><span class="lineCov">          4 :   luaD_checkstack(L, 4);</span>
<span class="lineNum">     103 </span><span class="lineCov">          4 :   L-&gt;top += 4;</span>
<span class="lineNum">     104 </span><span class="lineCov">          4 :   luaD_call(L, L-&gt;top - 4, 0);</span>
<span class="lineNum">     105 </span><span class="lineCov">          2 : }</span>
<span class="lineNum">     106 </span>            : 
<span class="lineNum">     107 </span>            : 
<span class="lineNum">     108 </span><span class="lineCov">     133380 : void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {</span>
<span class="lineNum">     109 </span>            :   int loop;
<span class="lineNum">     110 </span><span class="lineCov">     140530 :   for (loop = 0; loop &lt; MAXTAGLOOP; loop++) {</span>
<span class="lineNum">     111 </span>            :     const TValue *tm;
<span class="lineNum">     112 </span><span class="lineCov">     140530 :     if (ttistable(t)) {  /* `t' is a table? */</span>
<span class="lineNum">     113 </span><span class="lineCov">     133413 :       Table *h = hvalue(t);</span>
<span class="lineNum">     114 </span><span class="lineCov">     133413 :       const TValue *res = luaH_get(h, key); /* do a primitive get */</span>
<span class="lineNum">     115 </span><span class="lineCov">     133413 :       if (!ttisnil(res) ||  /* result is no nil? */</span>
<span class="lineNum">     116 </span><span class="lineCov">       1636 :           (tm = fasttm(L, h-&gt;metatable, TM_INDEX)) == NULL) { /* or no TM? */</span>
<span class="lineNum">     117 </span><span class="lineCov">     133361 :         setobj2s(L, val, res);</span>
<span class="lineNum">     118 </span><span class="lineCov">     133361 :         return;</span>
<span class="lineNum">     119 </span>            :       }
<span class="lineNum">     120 </span>            :       /* else will try the tag method */
<span class="lineNum">     121 </span>            :     }
<span class="lineNum">     122 </span><span class="lineCov">       7117 :     else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))</span>
<span class="lineNum">     123 </span><span class="lineCov">          7 :       luaG_typeerror(L, t, &quot;index&quot;);</span>
<span class="lineNum">     124 </span><span class="lineCov">       7162 :     if (ttisfunction(tm)) {</span>
<span class="lineNum">     125 </span><span class="lineCov">         12 :       callTMres(L, val, tm, t, key);</span>
<span class="lineNum">     126 </span><span class="lineCov">         12 :       return;</span>
<span class="lineNum">     127 </span>            :     }
<span class="lineNum">     128 </span><span class="lineCov">       7150 :     t = tm;  /* else repeat with `tm' */ </span>
<span class="lineNum">     129 </span>            :   }
<span class="lineNum">     130 </span><span class="lineNoCov">          0 :   luaG_runerror(L, &quot;loop in gettable&quot;);</span>
<span class="lineNum">     131 </span>            : }
<span class="lineNum">     132 </span>            : 
<span class="lineNum">     133 </span>            : 
<span class="lineNum">     134 </span><span class="lineCov">      99321 : void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {</span>
<span class="lineNum">     135 </span>            :   int loop;
<span class="lineNum">     136 </span>            :   TValue temp;
<span class="lineNum">     137 </span><span class="lineCov">      99322 :   for (loop = 0; loop &lt; MAXTAGLOOP; loop++) {</span>
<span class="lineNum">     138 </span>            :     const TValue *tm;
<span class="lineNum">     139 </span><span class="lineCov">      99322 :     if (ttistable(t)) {  /* `t' is a table? */</span>
<span class="lineNum">     140 </span><span class="lineCov">      99314 :       Table *h = hvalue(t);</span>
<span class="lineNum">     141 </span><span class="lineCov">      99314 :       TValue *oldval = luaH_set(L, h, key); /* do a primitive set */</span>
<span class="lineNum">     142 </span><span class="lineCov">      99312 :       if (!ttisnil(oldval) ||  /* result is no nil? */</span>
<span class="lineNum">     143 </span><span class="lineCov">      58294 :           (tm = fasttm(L, h-&gt;metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */</span>
<span class="lineNum">     144 </span><span class="lineCov">      99307 :         setobj2t(L, oldval, val);</span>
<span class="lineNum">     145 </span><span class="lineCov">      99307 :         h-&gt;flags = 0;</span>
<span class="lineNum">     146 </span><span class="lineCov">      99307 :         luaC_barriert(L, h, val);</span>
<span class="lineNum">     147 </span><span class="lineCov">      99309 :         return;</span>
<span class="lineNum">     148 </span>            :       }
<span class="lineNum">     149 </span>            :       /* else will try the tag method */
<span class="lineNum">     150 </span>            :     }
<span class="lineNum">     151 </span><span class="lineCov">          8 :     else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))</span>
<span class="lineNum">     152 </span><span class="lineCov">          8 :       luaG_typeerror(L, t, &quot;index&quot;);</span>
<span class="lineNum">     153 </span><span class="lineCov">          5 :     if (ttisfunction(tm)) {</span>
<span class="lineNum">     154 </span><span class="lineCov">          4 :       callTM(L, tm, t, key, val);</span>
<span class="lineNum">     155 </span><span class="lineCov">          2 :       return;</span>
<span class="lineNum">     156 </span>            :     }
<span class="lineNum">     157 </span>            :     /* else repeat with `tm' */
<span class="lineNum">     158 </span><span class="lineCov">          1 :     setobj(L, &amp;temp, tm);  /* avoid pointing inside table (may rehash) */</span>
<span class="lineNum">     159 </span><span class="lineCov">          1 :     t = &amp;temp;</span>
<span class="lineNum">     160 </span>            :   }
<span class="lineNum">     161 </span><span class="lineNoCov">          0 :   luaG_runerror(L, &quot;loop in settable&quot;);</span>
<span class="lineNum">     162 </span>            : }
<span class="lineNum">     163 </span>            : 
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span><span class="lineCov">        117 : static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2,</span>
<span class="lineNum">     166 </span>            :                        StkId res, TMS event) {
<span class="lineNum">     167 </span><span class="lineCov">        117 :   const TValue *tm = luaT_gettmbyobj(L, p1, event);  /* try first operand */</span>
<span class="lineNum">     168 </span><span class="lineCov">        117 :   if (ttisnil(tm))</span>
<span class="lineNum">     169 </span><span class="lineCov">        101 :     tm = luaT_gettmbyobj(L, p2, event);  /* try second operand */</span>
<span class="lineNum">     170 </span><span class="lineCov">        117 :   if (ttisnil(tm)) return 0;</span>
<span class="lineNum">     171 </span><span class="lineCov">         24 :   callTMres(L, res, tm, p1, p2);</span>
<span class="lineNum">     172 </span><span class="lineCov">         24 :   return 1;</span>
<span class="lineNum">     173 </span>            : }
<span class="lineNum">     174 </span>            : 
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span><span class="lineCov">          7 : static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2,</span>
<span class="lineNum">     177 </span>            :                                   TMS event) {
<span class="lineNum">     178 </span><span class="lineCov">          7 :   const TValue *tm1 = fasttm(L, mt1, event);</span>
<span class="lineNum">     179 </span>            :   const TValue *tm2;
<span class="lineNum">     180 </span><span class="lineCov">          7 :   if (tm1 == NULL) return NULL;  /* no metamethod */</span>
<span class="lineNum">     181 </span><span class="lineCov">          2 :   if (mt1 == mt2) return tm1;  /* same metatables =&gt; same metamethods */</span>
<span class="lineNum">     182 </span><span class="lineNoCov">          0 :   tm2 = fasttm(L, mt2, event);</span>
<span class="lineNum">     183 </span><span class="lineNoCov">          0 :   if (tm2 == NULL) return NULL;  /* no metamethod */</span>
<span class="lineNum">     184 </span><span class="lineNoCov">          0 :   if (luaO_rawequalObj(tm1, tm2))  /* same metamethods? */</span>
<span class="lineNum">     185 </span><span class="lineNoCov">          0 :     return tm1;</span>
<span class="lineNum">     186 </span><span class="lineNoCov">          0 :   return NULL;</span>
<span class="lineNum">     187 </span>            : }
<span class="lineNum">     188 </span>            : 
<span class="lineNum">     189 </span>            : 
<span class="lineNum">     190 </span><span class="lineCov">         48 : static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2,</span>
<span class="lineNum">     191 </span>            :                          TMS event) {
<span class="lineNum">     192 </span><span class="lineCov">         48 :   const TValue *tm1 = luaT_gettmbyobj(L, p1, event);</span>
<span class="lineNum">     193 </span>            :   const TValue *tm2;
<span class="lineNum">     194 </span><span class="lineCov">         48 :   if (ttisnil(tm1)) return -1;  /* no metamethod? */</span>
<span class="lineNum">     195 </span><span class="lineCov">          6 :   tm2 = luaT_gettmbyobj(L, p2, event);</span>
<span class="lineNum">     196 </span><span class="lineCov">          6 :   if (!luaO_rawequalObj(tm1, tm2))  /* different metamethods? */</span>
<span class="lineNum">     197 </span><span class="lineNoCov">          0 :     return -1;</span>
<span class="lineNum">     198 </span><span class="lineCov">          6 :   callTMres(L, L-&gt;top, tm1, p1, p2);</span>
<span class="lineNum">     199 </span><span class="lineCov">          6 :   return !l_isfalse(L-&gt;top);</span>
<span class="lineNum">     200 </span>            : }
<span class="lineNum">     201 </span>            : 
<span class="lineNum">     202 </span>            : 
<span class="lineNum">     203 </span><span class="lineCov">      91693 : static int l_strcmp (const TString *ls, const TString *rs) {</span>
<span class="lineNum">     204 </span><span class="lineCov">      91693 :   const char *l = getstr(ls);</span>
<span class="lineNum">     205 </span><span class="lineCov">      91693 :   size_t ll = ls-&gt;tsv.len;</span>
<span class="lineNum">     206 </span><span class="lineCov">      91693 :   const char *r = getstr(rs);</span>
<span class="lineNum">     207 </span><span class="lineCov">      91693 :   size_t lr = rs-&gt;tsv.len;</span>
<span class="lineNum">     208 </span><span class="lineCov">          1 :   for (;;) {</span>
<span class="lineNum">     209 </span><span class="lineCov">      91694 :     int temp = strcoll(l, r);</span>
<span class="lineNum">     210 </span><span class="lineCov">      91694 :     if (temp != 0) return temp;</span>
<span class="lineNum">     211 </span>            :     else {  /* strings are equal up to a `\0' */
<span class="lineNum">     212 </span><span class="lineCov">       2642 :       size_t len = strlen(l);  /* index of first `\0' in both strings */</span>
<span class="lineNum">     213 </span><span class="lineCov">       2642 :       if (len == lr)  /* r is finished? */</span>
<span class="lineNum">     214 </span><span class="lineCov">       2640 :         return (len == ll) ? 0 : 1;</span>
<span class="lineNum">     215 </span><span class="lineCov">          2 :       else if (len == ll)  /* l is finished? */</span>
<span class="lineNum">     216 </span><span class="lineCov">          1 :         return -1;  /* l is smaller than r (because r is not finished) */</span>
<span class="lineNum">     217 </span>            :       /* both strings longer than `len'; go on comparing (after the `\0') */
<span class="lineNum">     218 </span><span class="lineCov">          1 :       len++;</span>
<span class="lineNum">     219 </span><span class="lineCov">          1 :       l += len; ll -= len; r += len; lr -= len;</span>
<span class="lineNum">     220 </span>            :     }
<span class="lineNum">     221 </span>            :   }
<span class="lineNum">     222 </span>            : }
<span class="lineNum">     223 </span>            : 
<span class="lineNum">     224 </span>            : 
<span class="lineNum">     225 </span><span class="lineCov">      91720 : int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) {</span>
<span class="lineNum">     226 </span>            :   int res;
<span class="lineNum">     227 </span><span class="lineCov">      91720 :   if (ttype(l) != ttype(r))</span>
<span class="lineNum">     228 </span><span class="lineCov">         28 :     return luaG_ordererror(L, l, r);</span>
<span class="lineNum">     229 </span><span class="lineCov">      91692 :   else if (ttisnumber(l))</span>
<span class="lineNum">     230 </span><span class="lineCov">         54 :     return luai_numlt(nvalue(l), nvalue(r));</span>
<span class="lineNum">     231 </span><span class="lineCov">      91638 :   else if (ttisstring(l))</span>
<span class="lineNum">     232 </span><span class="lineCov">      91619 :     return l_strcmp(rawtsvalue(l), rawtsvalue(r)) &lt; 0;</span>
<span class="lineNum">     233 </span><span class="lineCov">         19 :   else if ((res = call_orderTM(L, l, r, TM_LT)) != -1)</span>
<span class="lineNum">     234 </span><span class="lineCov">          4 :     return res;</span>
<span class="lineNum">     235 </span><span class="lineCov">         15 :   return luaG_ordererror(L, l, r);</span>
<span class="lineNum">     236 </span>            : }
<span class="lineNum">     237 </span>            : 
<span class="lineNum">     238 </span>            : 
<span class="lineNum">     239 </span><span class="lineCov">      11388 : static int lessequal (lua_State *L, const TValue *l, const TValue *r) {</span>
<span class="lineNum">     240 </span>            :   int res;
<span class="lineNum">     241 </span><span class="lineCov">      11388 :   if (ttype(l) != ttype(r))</span>
<span class="lineNum">     242 </span><span class="lineCov">         18 :     return luaG_ordererror(L, l, r);</span>
<span class="lineNum">     243 </span><span class="lineCov">      11370 :   else if (ttisnumber(l))</span>
<span class="lineNum">     244 </span><span class="lineCov">      11281 :     return luai_numle(nvalue(l), nvalue(r));</span>
<span class="lineNum">     245 </span><span class="lineCov">         89 :   else if (ttisstring(l))</span>
<span class="lineNum">     246 </span><span class="lineCov">         74 :     return l_strcmp(rawtsvalue(l), rawtsvalue(r)) &lt;= 0;</span>
<span class="lineNum">     247 </span><span class="lineCov">         15 :   else if ((res = call_orderTM(L, l, r, TM_LE)) != -1)  /* first try `le' */</span>
<span class="lineNum">     248 </span><span class="lineCov">          1 :     return res;</span>
<span class="lineNum">     249 </span><span class="lineCov">         14 :   else if ((res = call_orderTM(L, r, l, TM_LT)) != -1)  /* else try `lt' */</span>
<span class="lineNum">     250 </span><span class="lineCov">          1 :     return !res;</span>
<span class="lineNum">     251 </span><span class="lineCov">         13 :   return luaG_ordererror(L, l, r);</span>
<span class="lineNum">     252 </span>            : }
<span class="lineNum">     253 </span>            : 
<span class="lineNum">     254 </span>            : 
<span class="lineNum">     255 </span><span class="lineCov">      25089 : int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {</span>
<span class="lineNum">     256 </span>            :   const TValue *tm;
<span class="lineNum">     257 </span>            :   lua_assert(ttype(t1) == ttype(t2));
<span class="lineNum">     258 </span><span class="lineCov">      25089 :   switch (ttype(t1)) {</span>
<span class="lineNum">     259 </span><span class="lineCov">        131 :     case LUA_TNIL: return 1;</span>
<span class="lineNum">     260 </span><span class="lineCov">        874 :     case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2));</span>
<span class="lineNum">     261 </span><span class="lineCov">        145 :     case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2);  /* true must be 1 !! */</span>
<span class="lineNum">     262 </span><span class="lineNoCov">          0 :     case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);</span>
<span class="lineNum">     263 </span><span class="lineCov">          8 :     case LUA_TUSERDATA: {</span>
<span class="lineNum">     264 </span><span class="lineCov">          8 :       if (uvalue(t1) == uvalue(t2)) return 1;</span>
<span class="lineNum">     265 </span><span class="lineCov">          1 :       tm = get_compTM(L, uvalue(t1)-&gt;metatable, uvalue(t2)-&gt;metatable,</span>
<span class="lineNum">     266 </span>            :                          TM_EQ);
<span class="lineNum">     267 </span><span class="lineCov">          1 :       break;  /* will try TM */</span>
<span class="lineNum">     268 </span>            :     }
<span class="lineNum">     269 </span><span class="lineCov">         38 :     case LUA_TTABLE: {</span>
<span class="lineNum">     270 </span><span class="lineCov">         38 :       if (hvalue(t1) == hvalue(t2)) return 1;</span>
<span class="lineNum">     271 </span><span class="lineCov">          6 :       tm = get_compTM(L, hvalue(t1)-&gt;metatable, hvalue(t2)-&gt;metatable, TM_EQ);</span>
<span class="lineNum">     272 </span><span class="lineCov">          6 :       break;  /* will try TM */</span>
<span class="lineNum">     273 </span>            :     }
<span class="lineNum">     274 </span><span class="lineCov">      23893 :     default: return gcvalue(t1) == gcvalue(t2);</span>
<span class="lineNum">     275 </span>            :   }
<span class="lineNum">     276 </span><span class="lineCov">          7 :   if (tm == NULL) return 0;  /* no TM? */</span>
<span class="lineNum">     277 </span><span class="lineCov">          2 :   callTMres(L, L-&gt;top, tm, t1, t2);  /* call TM */</span>
<span class="lineNum">     278 </span><span class="lineCov">          2 :   return !l_isfalse(L-&gt;top);</span>
<span class="lineNum">     279 </span>            : }
<span class="lineNum">     280 </span>            : 
<span class="lineNum">     281 </span>            : 
<span class="lineNum">     282 </span><span class="lineCov">      11137 : void luaV_concat (lua_State *L, int total, int last) {</span>
<span class="lineNum">     283 </span>            :   do {
<span class="lineNum">     284 </span><span class="lineCov">      11137 :     StkId top = L-&gt;base + last + 1;</span>
<span class="lineNum">     285 </span><span class="lineCov">      11137 :     int n = 2;  /* number of elements handled in this pass (at least 2) */</span>
<span class="lineNum">     286 </span><span class="lineCov">      11137 :     if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) {</span>
<span class="lineNum">     287 </span><span class="lineCov">         12 :       if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))</span>
<span class="lineNum">     288 </span><span class="lineCov">          9 :         luaG_concaterror(L, top-2, top-1);</span>
<span class="lineNum">     289 </span><span class="lineCov">      11125 :     } else if (tsvalue(top-1)-&gt;len == 0)  /* second op is empty? */</span>
<span class="lineNum">     290 </span><span class="lineCov">        543 :       (void)tostring(L, top - 2);  /* result is first op (as string) */</span>
<span class="lineNum">     291 </span>            :     else {
<span class="lineNum">     292 </span>            :       /* at least two string values; get as many as possible */
<span class="lineNum">     293 </span><span class="lineCov">      10582 :       size_t tl = tsvalue(top-1)-&gt;len;</span>
<span class="lineNum">     294 </span>            :       char *buffer;
<span class="lineNum">     295 </span>            :       int i;
<span class="lineNum">     296 </span>            :       /* collect total length */
<span class="lineNum">     297 </span><span class="lineCov">      29129 :       for (n = 1; n &lt; total &amp;&amp; tostring(L, top-n-1); n++) {</span>
<span class="lineNum">     298 </span><span class="lineCov">      18547 :         size_t l = tsvalue(top-n-1)-&gt;len;</span>
<span class="lineNum">     299 </span><span class="lineCov">      18547 :         if (l &gt;= MAX_SIZET - tl) luaG_runerror(L, &quot;string length overflow&quot;);</span>
<span class="lineNum">     300 </span><span class="lineCov">      18547 :         tl += l;</span>
<span class="lineNum">     301 </span>            :       }
<span class="lineNum">     302 </span><span class="lineCov">      10582 :       buffer = luaZ_openspace(L, &amp;G(L)-&gt;buff, tl);</span>
<span class="lineNum">     303 </span><span class="lineCov">      10582 :       tl = 0;</span>
<span class="lineNum">     304 </span><span class="lineCov">      39711 :       for (i=n; i&gt;0; i--) {  /* concat all strings */</span>
<span class="lineNum">     305 </span><span class="lineCov">      29129 :         size_t l = tsvalue(top-i)-&gt;len;</span>
<span class="lineNum">     306 </span><span class="lineCov">      29129 :         memcpy(buffer+tl, svalue(top-i), l);</span>
<span class="lineNum">     307 </span><span class="lineCov">      29129 :         tl += l;</span>
<span class="lineNum">     308 </span>            :       }
<span class="lineNum">     309 </span><span class="lineCov">      10582 :       setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl));</span>
<span class="lineNum">     310 </span>            :     }
<span class="lineNum">     311 </span><span class="lineCov">      11128 :     total -= n-1;  /* got `n' strings to create 1 new */</span>
<span class="lineNum">     312 </span><span class="lineCov">      11128 :     last -= n-1;</span>
<span class="lineNum">     313 </span><span class="lineCov">      11128 :   } while (total &gt; 1);  /* repeat until only 1 result left */</span>
<span class="lineNum">     314 </span><span class="lineCov">      10583 : }</span>
<span class="lineNum">     315 </span>            : 
<span class="lineNum">     316 </span>            : 
<span class="lineNum">     317 </span><span class="lineCov">        123 : static void Arith (lua_State *L, StkId ra, const TValue *rb,</span>
<span class="lineNum">     318 </span>            :                    const TValue *rc, TMS op) {
<span class="lineNum">     319 </span>            :   TValue tempb, tempc;
<span class="lineNum">     320 </span>            :   const TValue *b, *c;
<span class="lineNum">     321 </span><span class="lineCov">        182 :   if ((b = luaV_tonumber(rb, &amp;tempb)) != NULL &amp;&amp;</span>
<span class="lineNum">     322 </span><span class="lineCov">         83 :       (c = luaV_tonumber(rc, &amp;tempc)) != NULL) {</span>
<span class="lineNum">     323 </span><span class="lineCov">         24 :     lua_Number nb = nvalue(b), nc = nvalue(c);</span>
<span class="lineNum">     324 </span><span class="lineCov">         24 :     switch (op) {</span>
<span class="lineNum">     325 </span><span class="lineCov">          4 :       case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;</span>
<span class="lineNum">     326 </span><span class="lineCov">          3 :       case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;</span>
<span class="lineNum">     327 </span><span class="lineCov">          7 :       case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;</span>
<span class="lineNum">     328 </span><span class="lineCov">          3 :       case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break;</span>
<span class="lineNum">     329 </span><span class="lineCov">          3 :       case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break;</span>
<span class="lineNum">     330 </span><span class="lineCov">          3 :       case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;</span>
<span class="lineNum">     331 </span><span class="lineCov">          1 :       case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;</span>
<span class="lineNum">     332 </span><span class="lineNoCov">          0 :       default: lua_assert(0); break;</span>
<span class="lineNum">     333 </span>            :     }
<span class="lineNum">     334 </span>            :   }
<span class="lineNum">     335 </span><span class="lineCov">         99 :   else if (!call_binTM(L, rb, rc, ra, op))</span>
<span class="lineNum">     336 </span><span class="lineCov">         78 :     luaG_aritherror(L, rb, rc);</span>
<span class="lineNum">     337 </span><span class="lineCov">         45 : }</span>
<span class="lineNum">     338 </span>            : 
<span class="lineNum">     339 </span>            : 
<span class="lineNum">     340 </span>            : 
<span class="lineNum">     341 </span>            : /*
<span class="lineNum">     342 </span>            : ** some macros for common tasks in `luaV_execute'
<span class="lineNum">     343 </span>            : */
<span class="lineNum">     344 </span>            : 
<span class="lineNum">     345 </span>            : #define runtime_check(L, c)     { if (!(c)) break; }
<span class="lineNum">     346 </span>            : 
<span class="lineNum">     347 </span>            : #define RA(i)   (base+GETARG_A(i))
<span class="lineNum">     348 </span>            : /* to be used after possible stack reallocation */
<span class="lineNum">     349 </span>            : #define RB(i)   check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))
<span class="lineNum">     350 </span>            : #define RC(i)   check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))
<span class="lineNum">     351 </span>            : #define RKB(i)  check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \
<span class="lineNum">     352 </span>            :         ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))
<span class="lineNum">     353 </span>            : #define RKC(i)  check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \
<span class="lineNum">     354 </span>            :         ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))
<span class="lineNum">     355 </span>            : #define KBx(i)  check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i))
<span class="lineNum">     356 </span>            : 
<span class="lineNum">     357 </span>            : 
<span class="lineNum">     358 </span>            : #define dojump(L,pc,i)  {(pc) += (i); luai_threadyield(L);}
<span class="lineNum">     359 </span>            : 
<span class="lineNum">     360 </span>            : 
<span class="lineNum">     361 </span>            : #define Protect(x)      { L-&gt;savedpc = pc; {x;}; base = L-&gt;base; }
<span class="lineNum">     362 </span>            : 
<span class="lineNum">     363 </span>            : 
<span class="lineNum">     364 </span>            : #define arith_op(op,tm) { \
<span class="lineNum">     365 </span>            :         TValue *rb = RKB(i); \
<span class="lineNum">     366 </span>            :         TValue *rc = RKC(i); \
<span class="lineNum">     367 </span>            :         if (ttisnumber(rb) &amp;&amp; ttisnumber(rc)) { \
<span class="lineNum">     368 </span>            :           lua_Number nb = nvalue(rb), nc = nvalue(rc); \
<span class="lineNum">     369 </span>            :           setnvalue(ra, op(nb, nc)); \
<span class="lineNum">     370 </span>            :         } \
<span class="lineNum">     371 </span>            :         else \
<span class="lineNum">     372 </span>            :           Protect(Arith(L, ra, rb, rc, tm)); \
<span class="lineNum">     373 </span>            :       }
<span class="lineNum">     374 </span>            : 
<span class="lineNum">     375 </span>            : 
<span class="lineNum">     376 </span>            : 
<span class="lineNum">     377 </span><span class="lineCov">      43893 : void luaV_execute (lua_State *L, int nexeccalls) {</span>
<span class="lineNum">     378 </span>            :   LClosure *cl;
<span class="lineNum">     379 </span>            :   StkId base;
<span class="lineNum">     380 </span>            :   TValue *k;
<span class="lineNum">     381 </span>            :   const Instruction *pc;
<span class="lineNum">     382 </span><span class="lineCov">      43893 :  reentry:  /* entry point */</span>
<span class="lineNum">     383 </span>            :   lua_assert(isLua(L-&gt;ci));
<span class="lineNum">     384 </span><span class="lineCov">      43893 :   pc = L-&gt;savedpc;</span>
<span class="lineNum">     385 </span><span class="lineCov">      43893 :   cl = &amp;clvalue(L-&gt;ci-&gt;func)-&gt;l;</span>
<span class="lineNum">     386 </span><span class="lineCov">      43893 :   base = L-&gt;base;</span>
<span class="lineNum">     387 </span><span class="lineCov">      43893 :   k = cl-&gt;p-&gt;k;</span>
<span class="lineNum">     388 </span>            :   /* main loop of interpreter */
<span class="lineNum">     389 </span><span class="lineCov">     612007 :   for (;;) {</span>
<span class="lineNum">     390 </span><span class="lineCov">     655900 :     const Instruction i = *pc++;</span>
<span class="lineNum">     391 </span>            :     StkId ra;
<span class="lineNum">     392 </span><span class="lineCov">     655900 :     if ((L-&gt;hookmask &amp; (LUA_MASKLINE | LUA_MASKCOUNT)) &amp;&amp;</span>
<span class="lineNum">     393 </span><span class="lineCov">       1375 :         (--L-&gt;hookcount == 0 || L-&gt;hookmask &amp; LUA_MASKLINE)) {</span>
<span class="lineNum">     394 </span><span class="lineCov">         32 :       traceexec(L, pc);</span>
<span class="lineNum">     395 </span><span class="lineCov">         32 :       if (L-&gt;status == LUA_YIELD) {  /* did hook yield? */</span>
<span class="lineNum">     396 </span><span class="lineNoCov">          0 :         L-&gt;savedpc = pc - 1;</span>
<span class="lineNum">     397 </span><span class="lineNoCov">          0 :         return;</span>
<span class="lineNum">     398 </span>            :       }
<span class="lineNum">     399 </span><span class="lineCov">         32 :       base = L-&gt;base;</span>
<span class="lineNum">     400 </span>            :     }
<span class="lineNum">     401 </span>            :     /* warning!! several calls may realloc the stack and invalidate `ra' */
<span class="lineNum">     402 </span><span class="lineCov">     655900 :     ra = RA(i);</span>
<span class="lineNum">     403 </span>            :     lua_assert(base == L-&gt;base &amp;&amp; L-&gt;base == L-&gt;ci-&gt;base);
<span class="lineNum">     404 </span>            :     lua_assert(base &lt;= L-&gt;top &amp;&amp; L-&gt;top &lt;= L-&gt;stack + L-&gt;stacksize);
<span class="lineNum">     405 </span>            :     lua_assert(L-&gt;top == L-&gt;ci-&gt;top || luaG_checkopenop(i));
<span class="lineNum">     406 </span><span class="lineCov">     655900 :     switch (GET_OPCODE(i)) {</span>
<span class="lineNum">     407 </span><span class="lineCov">      87593 :       case OP_MOVE: {</span>
<span class="lineNum">     408 </span><span class="lineCov">      87593 :         setobjs2s(L, ra, RB(i));</span>
<span class="lineNum">     409 </span><span class="lineCov">      87593 :         continue;</span>
<span class="lineNum">     410 </span>            :       }
<span class="lineNum">     411 </span><span class="lineCov">      31790 :       case OP_LOADK: {</span>
<span class="lineNum">     412 </span><span class="lineCov">      31790 :         setobj2s(L, ra, KBx(i));</span>
<span class="lineNum">     413 </span><span class="lineCov">      31790 :         continue;</span>
<span class="lineNum">     414 </span>            :       }
<span class="lineNum">     415 </span><span class="lineCov">       7420 :       case OP_LOADBOOL: {</span>
<span class="lineNum">     416 </span><span class="lineCov">       7420 :         setbvalue(ra, GETARG_B(i));</span>
<span class="lineNum">     417 </span><span class="lineCov">       7420 :         if (GETARG_C(i)) pc++;  /* skip next instruction (if C) */</span>
<span class="lineNum">     418 </span><span class="lineCov">       7420 :         continue;</span>
<span class="lineNum">     419 </span>            :       }
<span class="lineNum">     420 </span><span class="lineCov">        539 :       case OP_LOADNIL: {</span>
<span class="lineNum">     421 </span><span class="lineCov">        539 :         TValue *rb = RB(i);</span>
<span class="lineNum">     422 </span>            :         do {
<span class="lineNum">     423 </span><span class="lineCov">        706 :           setnilvalue(rb--);</span>
<span class="lineNum">     424 </span><span class="lineCov">        706 :         } while (rb &gt;= ra);</span>
<span class="lineNum">     425 </span><span class="lineCov">        539 :         continue;</span>
<span class="lineNum">     426 </span>            :       }
<span class="lineNum">     427 </span><span class="lineCov">      32073 :       case OP_GETUPVAL: {</span>
<span class="lineNum">     428 </span><span class="lineCov">      32073 :         int b = GETARG_B(i);</span>
<span class="lineNum">     429 </span><span class="lineCov">      32073 :         setobj2s(L, ra, cl-&gt;upvals[b]-&gt;v);</span>
<span class="lineNum">     430 </span><span class="lineCov">      32073 :         continue;</span>
<span class="lineNum">     431 </span>            :       }
<span class="lineNum">     432 </span><span class="lineCov">      47829 :       case OP_GETGLOBAL: {</span>
<span class="lineNum">     433 </span>            :         TValue g;
<span class="lineNum">     434 </span><span class="lineCov">      47829 :         TValue *rb = KBx(i);</span>
<span class="lineNum">     435 </span><span class="lineCov">      47829 :         sethvalue(L, &amp;g, cl-&gt;env);</span>
<span class="lineNum">     436 </span>            :         lua_assert(ttisstring(rb));
<span class="lineNum">     437 </span><span class="lineCov">      47829 :         Protect(luaV_gettable(L, &amp;g, rb, ra));</span>
<span class="lineNum">     438 </span><span class="lineCov">      47829 :         continue;</span>
<span class="lineNum">     439 </span>            :       }
<span class="lineNum">     440 </span><span class="lineCov">      72826 :       case OP_GETTABLE: {</span>
<span class="lineNum">     441 </span><span class="lineCov">      72826 :         Protect(luaV_gettable(L, RB(i), RKC(i), ra));</span>
<span class="lineNum">     442 </span><span class="lineCov">      72819 :         continue;</span>
<span class="lineNum">     443 </span>            :       }
<span class="lineNum">     444 </span><span class="lineCov">        905 :       case OP_SETGLOBAL: {</span>
<span class="lineNum">     445 </span>            :         TValue g;
<span class="lineNum">     446 </span><span class="lineCov">        905 :         sethvalue(L, &amp;g, cl-&gt;env);</span>
<span class="lineNum">     447 </span>            :         lua_assert(ttisstring(KBx(i)));
<span class="lineNum">     448 </span><span class="lineCov">        905 :         Protect(luaV_settable(L, &amp;g, KBx(i), ra));</span>
<span class="lineNum">     449 </span><span class="lineCov">        904 :         continue;</span>
<span class="lineNum">     450 </span>            :       }
<span class="lineNum">     451 </span><span class="lineCov">       2565 :       case OP_SETUPVAL: {</span>
<span class="lineNum">     452 </span><span class="lineCov">       2565 :         UpVal *uv = cl-&gt;upvals[GETARG_B(i)];</span>
<span class="lineNum">     453 </span><span class="lineCov">       2565 :         setobj(L, uv-&gt;v, ra);</span>
<span class="lineNum">     454 </span><span class="lineCov">       2565 :         luaC_barrier(L, uv, ra);</span>
<span class="lineNum">     455 </span><span class="lineCov">       2565 :         continue;</span>
<span class="lineNum">     456 </span>            :       }
<span class="lineNum">     457 </span><span class="lineCov">      82810 :       case OP_SETTABLE: {</span>
<span class="lineNum">     458 </span><span class="lineCov">      82810 :         Protect(luaV_settable(L, ra, RKB(i), RKC(i)));</span>
<span class="lineNum">     459 </span><span class="lineCov">      82799 :         continue;</span>
<span class="lineNum">     460 </span>            :       }
<span class="lineNum">     461 </span><span class="lineCov">       6577 :       case OP_NEWTABLE: {</span>
<span class="lineNum">     462 </span><span class="lineCov">       6577 :         int b = GETARG_B(i);</span>
<span class="lineNum">     463 </span><span class="lineCov">       6577 :         int c = GETARG_C(i);</span>
<span class="lineNum">     464 </span><span class="lineCov">       6577 :         sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));</span>
<span class="lineNum">     465 </span><span class="lineCov">       6577 :         Protect(luaC_checkGC(L));</span>
<span class="lineNum">     466 </span><span class="lineCov">       6577 :         continue;</span>
<span class="lineNum">     467 </span>            :       }
<span class="lineNum">     468 </span><span class="lineCov">       7126 :       case OP_SELF: {</span>
<span class="lineNum">     469 </span><span class="lineCov">       7126 :         StkId rb = RB(i);</span>
<span class="lineNum">     470 </span><span class="lineCov">       7126 :         setobjs2s(L, ra+1, rb);</span>
<span class="lineNum">     471 </span><span class="lineCov">       7126 :         Protect(luaV_gettable(L, rb, RKC(i), ra));</span>
<span class="lineNum">     472 </span><span class="lineCov">       7126 :         continue;</span>
<span class="lineNum">     473 </span>            :       }
<span class="lineNum">     474 </span><span class="lineCov">      14271 :       case OP_ADD: {</span>
<span class="lineNum">     475 </span><span class="lineCov">      14271 :         arith_op(luai_numadd, TM_ADD);</span>
<span class="lineNum">     476 </span><span class="lineCov">      14259 :         continue;</span>
<span class="lineNum">     477 </span>            :       }
<span class="lineNum">     478 </span><span class="lineCov">      11055 :       case OP_SUB: {</span>
<span class="lineNum">     479 </span><span class="lineCov">      11055 :         arith_op(luai_numsub, TM_SUB);</span>
<span class="lineNum">     480 </span><span class="lineCov">      11044 :         continue;</span>
<span class="lineNum">     481 </span>            :       }
<span class="lineNum">     482 </span><span class="lineCov">       1159 :       case OP_MUL: {</span>
<span class="lineNum">     483 </span><span class="lineCov">       1159 :         arith_op(luai_nummul, TM_MUL);</span>
<span class="lineNum">     484 </span><span class="lineCov">       1145 :         continue;</span>
<span class="lineNum">     485 </span>            :       }
<span class="lineNum">     486 </span><span class="lineCov">         37 :       case OP_DIV: {</span>
<span class="lineNum">     487 </span><span class="lineCov">         37 :         arith_op(luai_numdiv, TM_DIV);</span>
<span class="lineNum">     488 </span><span class="lineCov">         26 :         continue;</span>
<span class="lineNum">     489 </span>            :       }
<span class="lineNum">     490 </span><span class="lineCov">         16 :       case OP_MOD: {</span>
<span class="lineNum">     491 </span><span class="lineCov">         16 :         arith_op(luai_nummod, TM_MOD);</span>
<span class="lineNum">     492 </span><span class="lineCov">          5 :         continue;</span>
<span class="lineNum">     493 </span>            :       }
<span class="lineNum">     494 </span><span class="lineCov">         20 :       case OP_POW: {</span>
<span class="lineNum">     495 </span><span class="lineCov">         20 :         arith_op(luai_numpow, TM_POW);</span>
<span class="lineNum">     496 </span><span class="lineCov">          9 :         continue;</span>
<span class="lineNum">     497 </span>            :       }
<span class="lineNum">     498 </span><span class="lineCov">         13 :       case OP_UNM: {</span>
<span class="lineNum">     499 </span><span class="lineCov">         13 :         TValue *rb = RB(i);</span>
<span class="lineNum">     500 </span><span class="lineCov">         13 :         if (ttisnumber(rb)) {</span>
<span class="lineNum">     501 </span><span class="lineCov">          3 :           lua_Number nb = nvalue(rb);</span>
<span class="lineNum">     502 </span><span class="lineCov">          3 :           setnvalue(ra, luai_numunm(nb));</span>
<span class="lineNum">     503 </span>            :         }
<span class="lineNum">     504 </span>            :         else {
<span class="lineNum">     505 </span><span class="lineCov">         10 :           Protect(Arith(L, ra, rb, rb, TM_UNM));</span>
<span class="lineNum">     506 </span>            :         }
<span class="lineNum">     507 </span><span class="lineCov">          5 :         continue;</span>
<span class="lineNum">     508 </span>            :       }
<span class="lineNum">     509 </span><span class="lineCov">         11 :       case OP_NOT: {</span>
<span class="lineNum">     510 </span><span class="lineCov">         11 :         int res = l_isfalse(RB(i));  /* next assignment may change this value */</span>
<span class="lineNum">     511 </span><span class="lineCov">         11 :         setbvalue(ra, res);</span>
<span class="lineNum">     512 </span><span class="lineCov">         11 :         continue;</span>
<span class="lineNum">     513 </span>            :       }
<span class="lineNum">     514 </span><span class="lineCov">        616 :       case OP_LEN: {</span>
<span class="lineNum">     515 </span><span class="lineCov">        616 :         const TValue *rb = RB(i);</span>
<span class="lineNum">     516 </span><span class="lineCov">        616 :         switch (ttype(rb)) {</span>
<span class="lineNum">     517 </span><span class="lineCov">        609 :           case LUA_TTABLE: {</span>
<span class="lineNum">     518 </span><span class="lineCov">        609 :             setnvalue(ra, cast_num(luaH_getn(hvalue(rb))));</span>
<span class="lineNum">     519 </span><span class="lineCov">        609 :             break;</span>
<span class="lineNum">     520 </span>            :           }
<span class="lineNum">     521 </span><span class="lineCov">          1 :           case LUA_TSTRING: {</span>
<span class="lineNum">     522 </span><span class="lineCov">          1 :             setnvalue(ra, cast_num(tsvalue(rb)-&gt;len));</span>
<span class="lineNum">     523 </span><span class="lineCov">          1 :             break;</span>
<span class="lineNum">     524 </span>            :           }
<span class="lineNum">     525 </span><span class="lineCov">          6 :           default: {  /* try metamethod */</span>
<span class="lineNum">     526 </span><span class="lineCov">          6 :             Protect(</span>
<span class="lineNum">     527 </span>            :               if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
<span class="lineNum">     528 </span>            :                 luaG_typeerror(L, rb, &quot;get length of&quot;);
<span class="lineNum">     529 </span>            :             )
<span class="lineNum">     530 </span>            :           }
<span class="lineNum">     531 </span>            :         }
<span class="lineNum">     532 </span><span class="lineCov">        610 :         continue;</span>
<span class="lineNum">     533 </span>            :       }
<span class="lineNum">     534 </span><span class="lineCov">       7850 :       case OP_CONCAT: {</span>
<span class="lineNum">     535 </span><span class="lineCov">       7850 :         int b = GETARG_B(i);</span>
<span class="lineNum">     536 </span><span class="lineCov">       7850 :         int c = GETARG_C(i);</span>
<span class="lineNum">     537 </span><span class="lineCov">       7850 :         Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L));</span>
<span class="lineNum">     538 </span><span class="lineCov">       7841 :         setobjs2s(L, RA(i), base+b);</span>
<span class="lineNum">     539 </span><span class="lineCov">       7841 :         continue;</span>
<span class="lineNum">     540 </span>            :       }
<span class="lineNum">     541 </span><span class="lineCov">      18244 :       case OP_JMP: {</span>
<span class="lineNum">     542 </span><span class="lineCov">      18244 :         dojump(L, pc, GETARG_sBx(i));</span>
<span class="lineNum">     543 </span><span class="lineCov">      18244 :         continue;</span>
<span class="lineNum">     544 </span>            :       }
<span class="lineNum">     545 </span><span class="lineCov">      25184 :       case OP_EQ: {</span>
<span class="lineNum">     546 </span><span class="lineCov">      25184 :         TValue *rb = RKB(i);</span>
<span class="lineNum">     547 </span><span class="lineCov">      25184 :         TValue *rc = RKC(i);</span>
<span class="lineNum">     548 </span><span class="lineCov">      25184 :         Protect(</span>
<span class="lineNum">     549 </span>            :           if (equalobj(L, rb, rc) == GETARG_A(i))
<span class="lineNum">     550 </span>            :             dojump(L, pc, GETARG_sBx(*pc));
<span class="lineNum">     551 </span>            :         )
<span class="lineNum">     552 </span><span class="lineCov">      25184 :         pc++;</span>
<span class="lineNum">     553 </span><span class="lineCov">      25184 :         continue;</span>
<span class="lineNum">     554 </span>            :       }
<span class="lineNum">     555 </span><span class="lineCov">        112 :       case OP_LT: {</span>
<span class="lineNum">     556 </span><span class="lineCov">        112 :         Protect(</span>
<span class="lineNum">     557 </span>            :           if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
<span class="lineNum">     558 </span>            :             dojump(L, pc, GETARG_sBx(*pc));
<span class="lineNum">     559 </span>            :         )
<span class="lineNum">     560 </span><span class="lineCov">         69 :         pc++;</span>
<span class="lineNum">     561 </span><span class="lineCov">         69 :         continue;</span>
<span class="lineNum">     562 </span>            :       }
<span class="lineNum">     563 </span><span class="lineCov">      11388 :       case OP_LE: {</span>
<span class="lineNum">     564 </span><span class="lineCov">      11388 :         Protect(</span>
<span class="lineNum">     565 </span>            :           if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
<span class="lineNum">     566 </span>            :             dojump(L, pc, GETARG_sBx(*pc));
<span class="lineNum">     567 </span>            :         )
<span class="lineNum">     568 </span><span class="lineCov">      11357 :         pc++;</span>
<span class="lineNum">     569 </span><span class="lineCov">      11357 :         continue;</span>
<span class="lineNum">     570 </span>            :       }
<span class="lineNum">     571 </span><span class="lineCov">      17372 :       case OP_TEST: {</span>
<span class="lineNum">     572 </span><span class="lineCov">      17372 :         if (l_isfalse(ra) != GETARG_C(i))</span>
<span class="lineNum">     573 </span><span class="lineCov">      15783 :           dojump(L, pc, GETARG_sBx(*pc));</span>
<span class="lineNum">     574 </span><span class="lineCov">      17372 :         pc++;</span>
<span class="lineNum">     575 </span><span class="lineCov">      17372 :         continue;</span>
<span class="lineNum">     576 </span>            :       }
<span class="lineNum">     577 </span><span class="lineCov">          4 :       case OP_TESTSET: {</span>
<span class="lineNum">     578 </span><span class="lineCov">          4 :         TValue *rb = RB(i);</span>
<span class="lineNum">     579 </span><span class="lineCov">          4 :         if (l_isfalse(rb) != GETARG_C(i)) {</span>
<span class="lineNum">     580 </span><span class="lineCov">          3 :           setobjs2s(L, ra, rb);</span>
<span class="lineNum">     581 </span><span class="lineCov">          3 :           dojump(L, pc, GETARG_sBx(*pc));</span>
<span class="lineNum">     582 </span>            :         }
<span class="lineNum">     583 </span><span class="lineCov">          4 :         pc++;</span>
<span class="lineNum">     584 </span><span class="lineCov">          4 :         continue;</span>
<span class="lineNum">     585 </span>            :       }
<span class="lineNum">     586 </span><span class="lineCov">      69616 :       case OP_CALL: {</span>
<span class="lineNum">     587 </span><span class="lineCov">      69616 :         int b = GETARG_B(i);</span>
<span class="lineNum">     588 </span><span class="lineCov">      69616 :         int nresults = GETARG_C(i) - 1;</span>
<span class="lineNum">     589 </span><span class="lineCov">      69616 :         if (b != 0) L-&gt;top = ra+b;  /* else previous instruction set top */</span>
<span class="lineNum">     590 </span><span class="lineCov">      69616 :         L-&gt;savedpc = pc;</span>
<span class="lineNum">     591 </span><span class="lineCov">      69616 :         switch (luaD_precall(L, ra, nresults)) {</span>
<span class="lineNum">     592 </span><span class="lineCov">      14891 :           case PCRLUA: {</span>
<span class="lineNum">     593 </span><span class="lineCov">      14891 :             nexeccalls++;</span>
<span class="lineNum">     594 </span><span class="lineCov">      14891 :             goto reentry;  /* restart luaV_execute over new Lua function */</span>
<span class="lineNum">     595 </span>            :           }
<span class="lineNum">     596 </span><span class="lineCov">      48673 :           case PCRC: {</span>
<span class="lineNum">     597 </span>            :             /* it was a C function (`precall' called it); adjust results */
<span class="lineNum">     598 </span><span class="lineCov">      48673 :             if (nresults &gt;= 0) L-&gt;top = L-&gt;ci-&gt;top;</span>
<span class="lineNum">     599 </span><span class="lineCov">      48673 :             base = L-&gt;base;</span>
<span class="lineNum">     600 </span><span class="lineCov">      48673 :             continue;</span>
<span class="lineNum">     601 </span>            :           }
<span class="lineNum">     602 </span><span class="lineCov">       5947 :           default: {</span>
<span class="lineNum">     603 </span><span class="lineCov">       5947 :             return;  /* yield */</span>
<span class="lineNum">     604 </span>            :           }
<span class="lineNum">     605 </span>            :         }
<span class="lineNum">     606 </span>            :       }
<span class="lineNum">     607 </span><span class="lineCov">       1262 :       case OP_TAILCALL: {</span>
<span class="lineNum">     608 </span><span class="lineCov">       1262 :         int b = GETARG_B(i);</span>
<span class="lineNum">     609 </span><span class="lineCov">       1262 :         if (b != 0) L-&gt;top = ra+b;  /* else previous instruction set top */</span>
<span class="lineNum">     610 </span><span class="lineCov">       1262 :         L-&gt;savedpc = pc;</span>
<span class="lineNum">     611 </span>            :         lua_assert(GETARG_C(i) - 1 == LUA_MULTRET);
<span class="lineNum">     612 </span><span class="lineCov">       1262 :         switch (luaD_precall(L, ra, LUA_MULTRET)) {</span>
<span class="lineNum">     613 </span><span class="lineCov">       1151 :           case PCRLUA: {</span>
<span class="lineNum">     614 </span>            :             /* tail call: put new frame in place of previous one */
<span class="lineNum">     615 </span><span class="lineCov">       1151 :             CallInfo *ci = L-&gt;ci - 1;  /* previous frame */</span>
<span class="lineNum">     616 </span>            :             int aux;
<span class="lineNum">     617 </span><span class="lineCov">       1151 :             StkId func = ci-&gt;func;</span>
<span class="lineNum">     618 </span><span class="lineCov">       1151 :             StkId pfunc = (ci+1)-&gt;func;  /* previous function index */</span>
<span class="lineNum">     619 </span><span class="lineCov">       1151 :             if (L-&gt;openupval) luaF_close(L, ci-&gt;base);</span>
<span class="lineNum">     620 </span><span class="lineCov">       1151 :             L-&gt;base = ci-&gt;base = ci-&gt;func + ((ci+1)-&gt;base - pfunc);</span>
<span class="lineNum">     621 </span><span class="lineCov">      11773 :             for (aux = 0; pfunc+aux &lt; L-&gt;top; aux++)  /* move frame down */</span>
<span class="lineNum">     622 </span><span class="lineCov">      10622 :               setobjs2s(L, func+aux, pfunc+aux);</span>
<span class="lineNum">     623 </span><span class="lineCov">       1151 :             ci-&gt;top = L-&gt;top = func+aux;  /* correct top */</span>
<span class="lineNum">     624 </span>            :             lua_assert(L-&gt;top == L-&gt;base + clvalue(func)-&gt;l.p-&gt;maxstacksize);
<span class="lineNum">     625 </span><span class="lineCov">       1151 :             ci-&gt;savedpc = L-&gt;savedpc;</span>
<span class="lineNum">     626 </span><span class="lineCov">       1151 :             ci-&gt;tailcalls++;  /* one more call lost */</span>
<span class="lineNum">     627 </span><span class="lineCov">       1151 :             L-&gt;ci--;  /* remove new frame */</span>
<span class="lineNum">     628 </span><span class="lineCov">       1151 :             goto reentry;</span>
<span class="lineNum">     629 </span>            :           }
<span class="lineNum">     630 </span><span class="lineCov">        108 :           case PCRC: {  /* it was a C function (`precall' called it) */</span>
<span class="lineNum">     631 </span><span class="lineCov">        108 :             base = L-&gt;base;</span>
<span class="lineNum">     632 </span><span class="lineCov">        108 :             continue;</span>
<span class="lineNum">     633 </span>            :           }
<span class="lineNum">     634 </span><span class="lineCov">          1 :           default: {</span>
<span class="lineNum">     635 </span><span class="lineCov">          1 :             return;  /* yield */</span>
<span class="lineNum">     636 </span>            :           }
<span class="lineNum">     637 </span>            :         }
<span class="lineNum">     638 </span>            :       }
<span class="lineNum">     639 </span><span class="lineCov">      21607 :       case OP_RETURN: {</span>
<span class="lineNum">     640 </span><span class="lineCov">      21607 :         int b = GETARG_B(i);</span>
<span class="lineNum">     641 </span><span class="lineCov">      21607 :         if (b != 0) L-&gt;top = ra+b-1;</span>
<span class="lineNum">     642 </span><span class="lineCov">      21607 :         if (L-&gt;openupval) luaF_close(L, base);</span>
<span class="lineNum">     643 </span><span class="lineCov">      21607 :         L-&gt;savedpc = pc;</span>
<span class="lineNum">     644 </span><span class="lineCov">      21607 :         b = luaD_poscall(L, ra);</span>
<span class="lineNum">     645 </span><span class="lineCov">      21607 :         if (--nexeccalls == 0)  /* was previous function running `here'? */</span>
<span class="lineNum">     646 </span><span class="lineCov">       6724 :           return;  /* no: return */</span>
<span class="lineNum">     647 </span>            :         else {  /* yes: continue its execution */
<span class="lineNum">     648 </span><span class="lineCov">      14883 :           if (b) L-&gt;top = L-&gt;ci-&gt;top;</span>
<span class="lineNum">     649 </span>            :           lua_assert(isLua(L-&gt;ci));
<span class="lineNum">     650 </span>            :           lua_assert(GET_OPCODE(*((L-&gt;ci)-&gt;savedpc - 1)) == OP_CALL);
<span class="lineNum">     651 </span><span class="lineCov">      14883 :           goto reentry;</span>
<span class="lineNum">     652 </span>            :         }
<span class="lineNum">     653 </span>            :       }
<span class="lineNum">     654 </span><span class="lineCov">      16053 :       case OP_FORLOOP: {</span>
<span class="lineNum">     655 </span><span class="lineCov">      16053 :         lua_Number step = nvalue(ra+2);</span>
<span class="lineNum">     656 </span><span class="lineCov">      16053 :         lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */</span>
<span class="lineNum">     657 </span><span class="lineCov">      16053 :         lua_Number limit = nvalue(ra+1);</span>
<span class="lineNum">     658 </span><span class="lineCov">      16053 :         if (luai_numlt(0, step) ? luai_numle(idx, limit)</span>
<span class="lineNum">     659 </span>            :                                 : luai_numle(limit, idx)) {
<span class="lineNum">     660 </span><span class="lineCov">      11601 :           dojump(L, pc, GETARG_sBx(i));  /* jump back */</span>
<span class="lineNum">     661 </span><span class="lineCov">      11601 :           setnvalue(ra, idx);  /* update internal index... */</span>
<span class="lineNum">     662 </span><span class="lineCov">      11601 :           setnvalue(ra+3, idx);  /* ...and external index */</span>
<span class="lineNum">     663 </span>            :         }
<span class="lineNum">     664 </span><span class="lineCov">      16053 :         continue;</span>
<span class="lineNum">     665 </span>            :       }
<span class="lineNum">     666 </span><span class="lineCov">       4462 :       case OP_FORPREP: {</span>
<span class="lineNum">     667 </span><span class="lineCov">       4462 :         const TValue *init = ra;</span>
<span class="lineNum">     668 </span><span class="lineCov">       4462 :         const TValue *plimit = ra+1;</span>
<span class="lineNum">     669 </span><span class="lineCov">       4462 :         const TValue *pstep = ra+2;</span>
<span class="lineNum">     670 </span><span class="lineCov">       4462 :         L-&gt;savedpc = pc;  /* next steps may throw errors */</span>
<span class="lineNum">     671 </span><span class="lineCov">       4462 :         if (!tonumber(init, ra))</span>
<span class="lineNum">     672 </span><span class="lineCov">          1 :           luaG_runerror(L, LUA_QL(&quot;for&quot;) &quot; initial value must be a number&quot;);</span>
<span class="lineNum">     673 </span><span class="lineCov">       4461 :         else if (!tonumber(plimit, ra+1))</span>
<span class="lineNum">     674 </span><span class="lineCov">          1 :           luaG_runerror(L, LUA_QL(&quot;for&quot;) &quot; limit must be a number&quot;);</span>
<span class="lineNum">     675 </span><span class="lineCov">       4460 :         else if (!tonumber(pstep, ra+2))</span>
<span class="lineNum">     676 </span><span class="lineCov">          1 :           luaG_runerror(L, LUA_QL(&quot;for&quot;) &quot; step must be a number&quot;);</span>
<span class="lineNum">     677 </span><span class="lineCov">       4459 :         setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep)));</span>
<span class="lineNum">     678 </span><span class="lineCov">       4459 :         dojump(L, pc, GETARG_sBx(i));</span>
<span class="lineNum">     679 </span><span class="lineCov">       4459 :         continue;</span>
<span class="lineNum">     680 </span>            :       }
<span class="lineNum">     681 </span><span class="lineCov">      52457 :       case OP_TFORLOOP: {</span>
<span class="lineNum">     682 </span><span class="lineCov">      52457 :         StkId cb = ra + 3;  /* call base */</span>
<span class="lineNum">     683 </span><span class="lineCov">      52457 :         setobjs2s(L, cb+2, ra+2);</span>
<span class="lineNum">     684 </span><span class="lineCov">      52457 :         setobjs2s(L, cb+1, ra+1);</span>
<span class="lineNum">     685 </span><span class="lineCov">      52457 :         setobjs2s(L, cb, ra);</span>
<span class="lineNum">     686 </span><span class="lineCov">      52457 :         L-&gt;top = cb+3;  /* func. + 2 args (state and index) */</span>
<span class="lineNum">     687 </span><span class="lineCov">      52457 :         Protect(luaD_call(L, cb, GETARG_C(i)));</span>
<span class="lineNum">     688 </span><span class="lineCov">      52457 :         L-&gt;top = L-&gt;ci-&gt;top;</span>
<span class="lineNum">     689 </span><span class="lineCov">      52457 :         cb = RA(i) + 3;  /* previous call may change the stack */</span>
<span class="lineNum">     690 </span><span class="lineCov">      52457 :         if (!ttisnil(cb)) {  /* continue loop? */</span>
<span class="lineNum">     691 </span><span class="lineCov">      46505 :           setobjs2s(L, cb-1, cb);  /* save control variable */</span>
<span class="lineNum">     692 </span><span class="lineCov">      46505 :           dojump(L, pc, GETARG_sBx(*pc));  /* jump back */</span>
<span class="lineNum">     693 </span>            :         }
<span class="lineNum">     694 </span><span class="lineCov">      52457 :         pc++;</span>
<span class="lineNum">     695 </span><span class="lineCov">      52457 :         continue;</span>
<span class="lineNum">     696 </span>            :       }
<span class="lineNum">     697 </span><span class="lineCov">        357 :       case OP_SETLIST: {</span>
<span class="lineNum">     698 </span><span class="lineCov">        357 :         int n = GETARG_B(i);</span>
<span class="lineNum">     699 </span><span class="lineCov">        357 :         int c = GETARG_C(i);</span>
<span class="lineNum">     700 </span>            :         int last;
<span class="lineNum">     701 </span>            :         Table *h;
<span class="lineNum">     702 </span><span class="lineCov">        357 :         if (n == 0) {</span>
<span class="lineNum">     703 </span><span class="lineCov">        220 :           n = cast_int(L-&gt;top - ra) - 1;</span>
<span class="lineNum">     704 </span><span class="lineCov">        220 :           L-&gt;top = L-&gt;ci-&gt;top;</span>
<span class="lineNum">     705 </span>            :         }
<span class="lineNum">     706 </span><span class="lineCov">        357 :         if (c == 0) c = cast_int(*pc++);</span>
<span class="lineNum">     707 </span><span class="lineCov">        357 :         runtime_check(L, ttistable(ra));</span>
<span class="lineNum">     708 </span><span class="lineCov">        357 :         h = hvalue(ra);</span>
<span class="lineNum">     709 </span><span class="lineCov">        357 :         last = ((c-1)*LFIELDS_PER_FLUSH) + n;</span>
<span class="lineNum">     710 </span><span class="lineCov">        357 :         if (last &gt; h-&gt;sizearray)  /* needs more space? */</span>
<span class="lineNum">     711 </span><span class="lineCov">        213 :           luaH_resizearray(L, h, last);  /* pre-alloc it at once */</span>
<span class="lineNum">     712 </span><span class="lineCov">       1377 :         for (; n &gt; 0; n--) {</span>
<span class="lineNum">     713 </span><span class="lineCov">       1020 :           TValue *val = ra+n;</span>
<span class="lineNum">     714 </span><span class="lineCov">       1020 :           setobj2t(L, luaH_setnum(L, h, last--), val);</span>
<span class="lineNum">     715 </span><span class="lineCov">       1020 :           luaC_barriert(L, h, val);</span>
<span class="lineNum">     716 </span>            :         }
<span class="lineNum">     717 </span><span class="lineCov">        357 :         continue;</span>
<span class="lineNum">     718 </span>            :       }
<span class="lineNum">     719 </span><span class="lineCov">        400 :       case OP_CLOSE: {</span>
<span class="lineNum">     720 </span><span class="lineCov">        400 :         luaF_close(L, ra);</span>
<span class="lineNum">     721 </span><span class="lineCov">        400 :         continue;</span>
<span class="lineNum">     722 </span>            :       }
<span class="lineNum">     723 </span><span class="lineCov">       2265 :       case OP_CLOSURE: {</span>
<span class="lineNum">     724 </span>            :         Proto *p;
<span class="lineNum">     725 </span>            :         Closure *ncl;
<span class="lineNum">     726 </span>            :         int nup, j;
<span class="lineNum">     727 </span><span class="lineCov">       2265 :         p = cl-&gt;p-&gt;p[GETARG_Bx(i)];</span>
<span class="lineNum">     728 </span><span class="lineCov">       2265 :         nup = p-&gt;nups;</span>
<span class="lineNum">     729 </span><span class="lineCov">       2265 :         ncl = luaF_newLclosure(L, nup, cl-&gt;env);</span>
<span class="lineNum">     730 </span><span class="lineCov">       2265 :         ncl-&gt;l.p = p;</span>
<span class="lineNum">     731 </span><span class="lineCov">       9306 :         for (j=0; j&lt;nup; j++, pc++) {</span>
<span class="lineNum">     732 </span><span class="lineCov">       7041 :           if (GET_OPCODE(*pc) == OP_GETUPVAL)</span>
<span class="lineNum">     733 </span><span class="lineCov">        734 :             ncl-&gt;l.upvals[j] = cl-&gt;upvals[GETARG_B(*pc)];</span>
<span class="lineNum">     734 </span>            :           else {
<span class="lineNum">     735 </span>            :             lua_assert(GET_OPCODE(*pc) == OP_MOVE);
<span class="lineNum">     736 </span><span class="lineCov">       6307 :             ncl-&gt;l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc));</span>
<span class="lineNum">     737 </span>            :           }
<span class="lineNum">     738 </span>            :         }
<span class="lineNum">     739 </span><span class="lineCov">       2265 :         setclvalue(L, ra, ncl);</span>
<span class="lineNum">     740 </span><span class="lineCov">       2265 :         Protect(luaC_checkGC(L));</span>
<span class="lineNum">     741 </span><span class="lineCov">       2265 :         continue;</span>
<span class="lineNum">     742 </span>            :       }
<span class="lineNum">     743 </span><span class="lineCov">         16 :       case OP_VARARG: {</span>
<span class="lineNum">     744 </span><span class="lineCov">         16 :         int b = GETARG_B(i) - 1;</span>
<span class="lineNum">     745 </span>            :         int j;
<span class="lineNum">     746 </span><span class="lineCov">         16 :         CallInfo *ci = L-&gt;ci;</span>
<span class="lineNum">     747 </span><span class="lineCov">         16 :         int n = cast_int(ci-&gt;base - ci-&gt;func) - cl-&gt;p-&gt;numparams - 1;</span>
<span class="lineNum">     748 </span><span class="lineCov">         16 :         if (b == LUA_MULTRET) {</span>
<span class="lineNum">     749 </span><span class="lineCov">         12 :           Protect(luaD_checkstack(L, n));</span>
<span class="lineNum">     750 </span><span class="lineCov">         12 :           ra = RA(i);  /* previous call may change the stack */</span>
<span class="lineNum">     751 </span><span class="lineCov">         12 :           b = n;</span>
<span class="lineNum">     752 </span><span class="lineCov">         12 :           L-&gt;top = ra + n;</span>
<span class="lineNum">     753 </span>            :         }
<span class="lineNum">     754 </span><span class="lineCov">         39 :         for (j = 0; j &lt; b; j++) {</span>
<span class="lineNum">     755 </span><span class="lineCov">         23 :           if (j &lt; n) {</span>
<span class="lineNum">     756 </span><span class="lineCov">         16 :             setobjs2s(L, ra + j, ci-&gt;base - n + j);</span>
<span class="lineNum">     757 </span>            :           }
<span class="lineNum">     758 </span>            :           else {
<span class="lineNum">     759 </span><span class="lineCov">          7 :             setnilvalue(ra + j);</span>
<span class="lineNum">     760 </span>            :           }
<span class="lineNum">     761 </span>            :         }
<span class="lineNum">     762 </span><span class="lineCov">         16 :         continue;</span>
<span class="lineNum">     763 </span>            :       }
<span class="lineNum">     764 </span>            :     }
<span class="lineNum">     765 </span><span class="lineCov">     612007 :   }</span>
<span class="lineNum">     766 </span>            : }
<span class="lineNum">     767 </span>            : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.13</a></td></tr>
  </table>
  <br>

</body>
</html>
